In this tutorial, you have learned the following:
At all times, it is important to remember what the meaning of the data stored in a texture is.
Most of the time, when a texture represents actual colors, those colors are in the sRGB colorspace. An appropriate image format must be selected.
Linear operations like filtering must be performed on linear values. All of OpenGL's operations on sRGB textures do this.
Similarly, the generation of mipmaps, a linear operation, must perform conversion from sRGB to lRGB, do the filtering, and then convert back. Since OpenGL does not (usually) generate mipmaps, it is incumbent upon the creator of the image to ensure that the mipmaps were generated properly.
Lighting operations need linear values.
The framebuffer can also be in the sRGB colorspace. OpenGL also requires a special enable when doing so, thus allowing for some parts of the rendering to be sRGB encoded and other parts not.
Enables/disables the conversion from linear to sRGB. When this is enabled, colors written by the fragment shader to an sRGB image are assumed to be linear. They are therefore converted into the sRGB colorspace. When this is disabled, the colors written by the fragment shader are assumed to already be in the sRGB colorspace; they are written exactly as given.